package com.xs.letcode;


import java.math.BigInteger;

/**
 * @author xs
 * date 2018/9/12 17:47
 */
public class BuShu {

	public static void main(String[] args) {
		int num = 5;
		String result = Integer.toBinaryString(num);
		System.out.println(result);
		char[] charsA = result.toCharArray();
		for (int i = 0; i < charsA.length; i++) {
			charsA[i] = (charsA[i] == '0' ? '1' : '0');
		}
		String s = new String(charsA);
		BigInteger bi = new BigInteger(s, 2);
		System.out.println(bi.intValue());


	}


}
